package cn.yangliu.jdbc.dymanicdb;

/**
 * @author Xiong Hao
 */
public class DataSourceContextHolder {

    private static final ThreadLocal<String> contextHolder = new ThreadLocal<>();

    public static ThreadLocal<String> getContextHolder() {
        return contextHolder;
    }

    public static String getDataSourceType() {
        return contextHolder.get();
    }

    public static void setDataSourceType(String type) {
        contextHolder.set(type);
    }

    public static void clearDataSourceType() {
        contextHolder.remove();
    }

}
